package com.powernode.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class HelloController {
    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }

    @GetMapping("/a")
    public String toA() {
//        return "A";
//        return "forward:/b";//转发
        return "redirect:/b";//重定向
    }

    @GetMapping("/b")
    public String toB() {
        return "B";
    }
}
